#define _CRT_SECURE_NO_WARNINGS 1
#include "heap.h"

void test1()
{
	HP p;
	HeapInit(&p);
	HeapPush(&p, 0);
	HeapPush(&p, 7);
	HeapPush(&p, 8);
	HeapPush(&p, 9);
	HeapPush(&p, 4);
	HeapPrint(&p);

	HeapPop(&p);
	HeapPrint(&p);

	HeapPop(&p);
	HeapPrint(&p);

	HeapPop(&p);
	HeapPrint(&p);

	HeapPop(&p);
	HeapPrint(&p);

	HeapPop(&p);
	HeapPrint(&p);

	//HeapPop(&p);
	//HeapPrint(&p);


}


void test2()
{
	int a[] = { 9,1,8,7,2,6,5,3,48,65,23,15,5 };
	size_t size = sizeof(a) / sizeof(a[0]);
	HeapSort(a, size);
	for (size_t i = 0; i < size; i++)
	{
		printf("%d ", a[i]);
	}
	printf("\n");
}

int main()
{
	//test1();
	test2();
	return 0;
}